<template>
  <div>
    <van-nav-bar
      title="收藏列表"
      left-arrow
      class="formtop"
      @click-left="onClickLeft"
    />
    <br />
    <van-swipe-cell>
      <CoLLect v-for="item in renderData" :key="item.id" :item="item" />
    </van-swipe-cell>
  </div>
</template>

<script>
import CoLLect from "../components/CoLLect.vue";
import { collection } from "@/api/user";
export default {
  name: "MyCollection",
  components: {
    CoLLect,
  },
  props: {},
  data() {
    return {
      renderData: [],
    };
  },
  computed: {},
  watch: {},
  async created() {
    const data = await collection();
    console.log(data);
    this.renderData = [...this.renderData, ...data.body];
  },
  methods: {
    onClickLeft() {
      this.$router.push("/mylogin");
    },
  },
};
</script>

<style scoped>
.van-card price {
  color: red;
}
</style>
